#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct jie
{
	char n;
	int i;
	jie * next;
}dian ;
dian * init()
{
	dian * a=NULL;
	a=(dian *)malloc(sizeof(dian));
	a->i =0;
	a->n ='0';
	a->next =NULL;
	return a;
}
dian * wei(dian * p)
{
	dian * a=p;
	while(a->next !=NULL)
		a=a->next ;
	return a;
}
int wi(dian * p)
{
	dian * a=p;
	a=wei(p);
	return a->i ;
}
char wn(dian * p)
{
	dian * a=p;
	a=wei(p);
	return a->n ;
}
void jia(dian * p,char x)
{
	dian * a=NULL;
	a=init();
	a->n =x;
	a->i =wi(p)+1;
	dian * b=wei(p);
	b->next =a;
}
dian * ww(dian * p)
{
	dian * a=wei(p);
	dian * b=p;
	while(b->next !=a)
	{
		b=b->next ;
	}
	return b;
}
void shan(dian * p)
{
	dian * a=wei(p);
	dian * b=ww(p);
	b->next =NULL;
	free(a);
}
int youxian(char x)
{
	if(x=='*'||x=='/')
		return 4;
	else if(x=='+'||x=='-')
		return 3;
	else if(x=='(')
		return 2;
	else if(x=='#')
		return 1;
	else
		return 0;
}
void main()
{
	dian * p=init();
	jia(p,'#');
	char shi[20],hou[20];
	scanf("%s",shi);
	int n;
	n=strlen(shi);
	shi[n]='#';
	shi[n+1]='\0';
	char x;
	int i=0,k=0;
	while(shi[i]!='\0')
	{
		if(shi[i]>='0'&&shi[i]<='9')
		{
			hou[k++]=shi[i++];
		}
		else
		{
			switch(shi[i])
			{
			case'(':
				{
					jia(p,shi[i++]);
					break;
				}
			case')':
				{
					x=wn(p);
					shan(p);
					while(x!='(')
					{
						hou[k++]=x;
						x=wn(p);
						shan(p);
					}
					i++;
					break;
				}
			default:
				{
					x=wn(p);
					if(youxian(x)<youxian(shi[i]))
					{
						if(shi[i]!='#')
							jia(p,shi[i]);
					}
					else
					{
						hou[k++]=x;
						shan(p);
						x=wn(p);
					}
					i++;
				}
			}
		}
	}
	hou[k]='\0';
	printf("%s",hou);
}